package com.sc.nft.entity.vo;

import cn.hutool.core.util.ObjectUtil;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;

@Data
public class TotalPerformanceVO {

    @ApiModelProperty("总业绩")
    private String totalPerformance;

    @ApiModelProperty("团队持仓成本")
    private String teamCost;

    @ApiModelProperty("团队有效用户")
    private Integer validatedUser;

    @ApiModelProperty("团队社区网点")
    private Integer teamCommunityNetwork;

    @ApiModelProperty("团队城市服务中心")
    private Integer teamCityServiceCenter;

    public void setTeamPerformanceThisMonth(BigDecimal totalPerformance) {
        if (ObjectUtil.isEmpty(totalPerformance)) {
            totalPerformance = BigDecimal.ZERO;
        }
        this.totalPerformance = totalPerformance.setScale(2, BigDecimal.ROUND_DOWN).toPlainString();
    }

    public void setTeamCost(BigDecimal teamCost) {
        if (ObjectUtil.isEmpty(teamCost)) {
            teamCost = BigDecimal.ZERO;
        }
        this.teamCost = teamCost.setScale(2, BigDecimal.ROUND_DOWN).toPlainString();
    }

}
